package com.woniuxy.entity;

import java.io.Serializable;
import java.math.BigDecimal;

import com.woniuxy.entity.DTO.FlashSaleProductDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

/**
 * 活动商品表
 * @TableName flash_sale_products
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FlashSaleProducts implements Serializable {
    /**
     * 活动商品ID
     */
    private Integer saleProductId;

    /**
     * 活动ID
     */
    private Integer saleId;

    /**
     * 商品ID
     */
    private Integer productId;

    /**
     * 抢购价格
     */
    private BigDecimal flashPrice;

    /**
     * 抢购库存
     */
    private Integer flashStock;

    /**
     * 每人限购数量
     */
    private Integer maxPurchase;

    /**
     * 商品状态(1:未开始,2:抢购中,3:已结束)
     */
    private Integer saleStatus;

    public FlashSaleProducts(FlashSaleProductDTO flashSaleProductDTO) {
        BeanUtils.copyProperties(flashSaleProductDTO, this);
    }
}